package org.crazyit.album.web.base;

import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import org.springframework.context.*;
import org.springframework.web.context.support.*;
import org.crazyit.album.service.AlbumService;

public class BaseServlet extends HttpServlet {
    protected AlbumService as;

    public void init(ServletConfig config)
            throws ServletException {
        super.init(config);
        ApplicationContext ctx = WebApplicationContextUtils
                .getWebApplicationContext(getServletContext());
        as = (AlbumService) ctx.getBean("albumService");
    }
}
